﻿using wRPC;
namespace testdll2
{
    [Route("hron/led")]//路由地址
    public class LedApiController : FunctionBase
    {
       // SerialPort serialPort = new SerialPort();

          [Authorize]
        [InstallFun(FunAttribute.Get)]
        public string ledcom(string ff)
        {
            try
            {
                this.Headers["appId"].ToString();
                 
                //serialPort.PortName = com; // 设置串口号
                //serialPort.BaudRate = 9600;   // 设置波特率
                //serialPort.DataBits = 8;
                //serialPort.Parity = Parity.None;
                //serialPort.Open(); // 打开串口
                //serialPort.Write(strings, 0, strings.Length);
                //serialPort.Close();
            }
            catch { }
            return ff;

        }

        [Authorize("abc", "admin")]
        [InstallFun(FunAttribute.Get)]
        public string ledcom2(string ff)
        {
            try
            {


                //serialPort.PortName = com; // 设置串口号
                //serialPort.BaudRate = 9600;   // 设置波特率
                //serialPort.DataBits = 8;
                //serialPort.Parity = Parity.None;
                //serialPort.Open(); // 打开串口
                //serialPort.Write(strings, 0, strings.Length);
                //serialPort.Close();
            }
            catch { }
            return ff;

        }
        [Authorize("bbc", "admin")]
        [InstallFun(FunAttribute.Get)]
        public string ledcom3(string ff)
        {
            try
            {


                //serialPort.PortName = com; // 设置串口号
                //serialPort.BaudRate = 9600;   // 设置波特率
                //serialPort.DataBits = 8;
                //serialPort.Parity = Parity.None;
                //serialPort.Open(); // 打开串口
                //serialPort.Write(strings, 0, strings.Length);
                //serialPort.Close();
            }
            catch { }
            return ff;

        }

        [Authorize("", "user")]
        [InstallFun(FunAttribute.Get)]
        public string ledcom4(string ff)
        {
            try
            {


                //serialPort.PortName = com; // 设置串口号
                //serialPort.BaudRate = 9600;   // 设置波特率
                //serialPort.DataBits = 8;
                //serialPort.Parity = Parity.None;
                //serialPort.Open(); // 打开串口
                //serialPort.Write(strings, 0, strings.Length);
                //serialPort.Close();
            }
            catch { }
            return ff;

        }
        public class commode
        {
            public string com;
            public byte[] strings;
        }
    }
   
 
}
